home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / New System Software Extensions / QuickDraw™ GX v1.0ß2 / Interfaces & Libraries / interfaces / graphics debugging.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-29  |  5.8 KB  |  163 lines  |  [TEXT/MPS ]

  1. /* graphics:
  2.     debugging routines
  3.     by Cary Clark, Georgiann Delaney, Michael Fairman, Dave Good, Robert Johnson, Keith McGreggor, Oliver Steele, David Van Brink, Chris Yerga
  4.     Copyright 1987 - 1991 Apple Computer, Inc.  All rights reserved.    */
  5.  
  6. #pragma once
  7. #ifndef graphicsDebuggingIncludes
  8.     #define graphicsDebuggingIncludes
  9.     #ifndef graphicsTypesIncludes
  10.         #include "graphics types.h"
  11.     #endif
  12.  
  13.     typedef enum {
  14.  
  15.     /* These levels tell how to validate routines.  Choose one. */
  16.         gxNoValidation                = 0x00,     /* no validation */
  17.         gxPublicValidation                = 0x01,     /* check parameters to public routines */
  18.         gxInternalValidation          = 0x02,     /* check parameters to internal routines */
  19.  
  20.     /* These levels tell how to validate types.  Choose one. */
  21.         gxTypeValidation              = 0x00,     /* check types of objects */
  22.         gxStructureValidation         = 0x10,     /* check fields of private structures */
  23.         gxAllObjectValidation         = 0x20,     /* check every object over every call */
  24.  
  25.     /* These levels tell how to validate memory manager blocks.  Choose any combination. */
  26.         gxNoMemoryManagerValidation   = 0x0000,
  27.         gxApBlockValidation           = 0x0100,   /* check the relevant block structures after each memory mgr. call */
  28.         gxFontBlockValidation         = 0x0200,   /* check the system gxHeap as well */
  29.         gxApHeapValidation            = 0x0400,   /* check the memory manager’s gxHeap after every mem. call */
  30.         gxFontHeapValidation          = 0x0800,   /* check the system gxHeap as well */
  31.         gxCheckApHeapValidation       = 0x1000,   /* check the memory manager’s gxHeap if checking routine parameters */
  32.         gxCheckFontHeapValidation     = 0x2000        /* check the system gxHeap as well */
  33.  
  34.     } gxValidationLevels;
  35.  
  36.     typedef long gxValidationLevel;
  37.  
  38.     typedef enum {
  39.         no_draw_error,
  40.  
  41.         /* gxShape type errors */
  42.         shape_emptyType,
  43.         shape_inverse_fullType,
  44.         rectangle_zero_width,
  45.         rectangle_zero_height,
  46.         polygon_empty,
  47.         path_empty,
  48.         bitmap_zero_width,
  49.         bitmap_zero_height,
  50.         text_empty,
  51.         glyph_empty,
  52.         layout_empty,
  53.         picture_empty,
  54.  
  55.         /* general gxShape errors */
  56.         shape_no_fill,
  57.         shape_no_enclosed_area,
  58.         shape_no_enclosed_pixels,
  59.         shape_very_small,
  60.         shape_very_large,
  61.         shape_contours_cancel,
  62.  
  63.         /* gxStyle errors */
  64.         pen_too_small,
  65.         text_size_too_small,
  66.         dash_empty,
  67.         start_cap_empty,
  68.         pattern_empty,
  69.         textFace_empty,
  70.         shape_primitive_empty,
  71.         shape_primitive_very_small,
  72.  
  73.         /* gxInk errors */
  74.         transfer_equals_noMode,
  75.         transfer_matrix_ignores_source,
  76.         transfer_matrix_ignores_device,
  77.         transfer_source_reject,
  78.         transfer_mode_ineffective,
  79.         colorSet_no_entries,
  80.         bitmap_colorSet_one_entry,
  81.  
  82.         /* gxTransform errors */
  83.         transform_scale_too_small,
  84.         transform_map_too_large,
  85.         transform_move_too_large,
  86.         transform_scale_too_large,
  87.         transform_rotate_too_large,
  88.         transform_perspective_too_large,
  89.         transform_skew_too_large,
  90.         transform_clip_no_intersection,
  91.         transform_clip_empty,
  92.         transform_no_viewPorts,
  93.  
  94.         /* gxViewPort errors */
  95.         viewPort_disposed,
  96.         viewPort_clip_empty,
  97.         viewPort_clip_no_intersection,
  98.         viewPort_scale_too_small,
  99.         viewPort_map_too_large,
  100.         viewPort_move_too_large,
  101.         viewPort_scale_too_large,
  102.         viewPort_rotate_too_large,
  103.         viewPort_perspective_too_large,
  104.         viewPort_skew_too_large,
  105.         viewPort_viewGroup_offscreen,
  106.  
  107.         /* gxViewDevice errors */
  108.         viewDevice_clip_no_intersection,
  109.         viewDevice_scale_too_small,
  110.         viewDevice_map_too_large,
  111.         viewDevice_move_too_large,
  112.         viewDevice_scale_too_large,
  113.         viewDevice_rotate_too_large,
  114.         viewDevice_perspective_too_large,
  115.         viewDevice_skew_too_large
  116.     } gxDrawErrors;
  117.  
  118.     typedef long gxDrawError;
  119.  
  120.     typedef boolean (*gxUserDebugFunction)(const char *str, long message, long reference);
  121.  
  122.     #ifdef appleInternal
  123.         #define GXInlineCode(x)
  124.     #endif
  125.     #ifndef GXInlineCode
  126.         #define GXInlineCode(x)   = {0x303C, x, 0xA832}
  127.     #endif
  128.  
  129.     #ifdef __cplusplus
  130.     extern "C" {
  131.     #endif
  132.  
  133.     gxDrawError GXGetShapeDrawError(gxShape source) GXInlineCode(0x1173);
  134.  
  135.     void GXValidateAll(void) GXInlineCode(0x117E);
  136.     void GXValidateColorSet(gxColorSet) GXInlineCode(0x1174);
  137.     void GXValidateColorProfile(gxColorProfile) GXInlineCode(0x1175);
  138.     void GXValidateGraphicsClient(gxGraphicsClient) GXInlineCode(0x3006);
  139.     void GXValidateInk(gxInk) GXInlineCode(0x1176);
  140.     void GXValidateShape(gxShape) GXInlineCode(0x1177);
  141.     void GXValidateStyle(gxStyle) GXInlineCode(0x1178);
  142.     void GXValidateTag(gxTag) GXInlineCode(0x1179);
  143.     void GXValidateTransform(gxTransform) GXInlineCode(0x117A);
  144.     void GXValidateViewDevice(gxViewDevice) GXInlineCode(0x117B);
  145.     void GXValidateViewPort(gxViewPort) GXInlineCode(0x117C);
  146.     void GXValidateViewGroup(gxViewGroup) GXInlineCode(0x117D);
  147.  
  148.     gxValidationLevel GXGetValidation(void) GXInlineCode(0x2011);
  149.     void GXSetValidation(gxValidationLevel) GXInlineCode(0x2012);
  150.  
  151.     long GXGetValidationError(char *procedureName, void **argument, long *argumentNumber) GXInlineCode(0x1244);
  152.     boolean GXGetGraphicsBugParametersPointer(struct graphicsBugParameters **blockPointer) GXInlineCode(0x125C);
  153.     gxUserDebugFunction GXGetUserGraphicsDebug(long *reference) GXInlineCode(0x3018);
  154.     void GXSetUserGraphicsDebug(gxUserDebugFunction userFunction, long reference) GXInlineCode(0x3019);
  155.  
  156.     #ifdef __cplusplus
  157.     }
  158.     #endif
  159.  
  160.     #undef GXInlineCode
  161.  
  162. #endif
  163.